﻿CREATE PROCEDURE [dbo].[ETL_SP_GetPagedVDataTableList]
	@Start int,
	@Limit int
AS
	SELECT T.* 
	FROM(
		SELECT 
			ROW_NUMBER() OVER(Order BY DT.Name) as _RowIndex,
			DT.*,
			DS.Name as MappedDataSource,
			DS.Id as MappedDataSourceId,
			DS.DtSerId as MappedDataServiceId
		FROM ETL_DtTable as DT
			LEFT JOIN ETL_DtSourceMapping AS DSM on DSM.DtTableId = DT.Id
			LEFT JOIN ETL_DtSource AS DS on DS.Id = DSM.DtSourceId
		) as T
		WHERE T._RowIndex > @Start and T._RowIndex <= @Start + @Limit
RETURN 0
